<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>外采商品管理</title>



<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent tables">
  <div class="pageheader notab">
    <h1 class="pagetitle">外采商品列表</h1>
    
  <span class="pagedesc">1、上架90天内按利润的10% <br>&nbsp;&nbsp;&nbsp;&nbsp; 2、上架90天后至365天按利润1%<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3、订单包含多个商品时，运费收入和运费成本按重量比摊单个SKU费用<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4、订单出现负利润，平摊50%
  </span>
    <div class="menulist">
    <ul class="profile_summary">
       <li class="current"> <a href="/datareport/externalBuy_refund" target="_blank"><span>退款列表</span></a></li>
       <li class="current"> <a href="/datareport/ajaxbutton?op=historyList" target="_blank"><span>已结算列表</span></a></li>
      </ul>
  </div>
     </div>
  <!--pageheader-->
     <div>
   		<div style="float:left">{{if $managers || in_array('263',$showpower)}}  &nbsp;&nbsp; <a href="javascript:void(0)" onClick="MergeProduct()" class="btn btn2 btn_help"><span>结算</span></a>
       
        {{/if}}</div>
         <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
   </div>
  <div id="contentwrapper" class="contentwrapper"> 
    <!--搜索栏-->
    <form class="stdform stdform2" method="get" action="/datareport/externalBuy">
      <div class="tableoptions"> 上架时间
        <input type="text"  name="starttime" id="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" id="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
       关键词: <input type="text" name="other" id="other" class="width100" value="{{$other}}" />
        开发者:
        <select name="developer" id="developer" class="selection select2_group" style="width:100px;" >
            <option value="0">请选择</option>
            {{foreach from=$userlist item=res key=key}}
            <option value="{{$res}}" {{if $developer eq $res}} selected{{/if}}>{{$res}}</option>
            {{/foreach}}
        </select>
        &nbsp;
        <button class="btn btn_orange btn_search radius50">Search</button>
        
        
        <span id="allcount"></span>
      </div>
    </form>
    <!--搜索栏结束-->
    
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
      <colgroup>
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      </colgroup>
      <thead>
        <tr>
         
          <th class="head0"><a href="/datareport/productlist?orderbysku={{$orderbysku}}">商品编号</a><span style="margin-top:15px;">&nbsp;&nbsp;<img src="/fuman/images/{{if $orderbysku=='DESC'}}arrowdown{{else}}arrowup{{/if}}.png"> </span></th>
          <th class="head1">商品名称</th>
          <th class="head0">上架时间</th>
          <th class="head1">90天 </th>
          <th class="head0">275天</th>
          <th class="head0">开发者</th>
          <th class="head0">上次结算时间</th>
          <th class="head0">未结算提成</th>
          <th class="head0">已结算提成</th>
          <th class="head0">操作</th>
        </tr>
      </thead>
      <tbody>
      
      {{foreach from=$list item=li key=key}}
      <tr>
        <td><a href="/product/productlist?other={{$li.sku}}" target="_blank">{{$li.sku}}</a></td>
        <td>{{$li.p_parent_name}}</td>
        <td>{{$li.finishTime}}</td>
        <td class="center">{{$li.onefinishTime}}</td>
        <td class="center">{{$li.TwofinishTime}}</td>
        <td class="center">{{$li.protector}}</td>
        <td class="center">{{if $li.cutoff_time=='0000-00-00'}}未结算{{else}}{{$li.cutoff_time}}{{/if}}</td>
        <td class="center">{{if $li.money.alllastMoney =='0'}}0.00{{else}}<font color="red">{{$li.money.alllastMoney}}</font>{{/if}}</td>
         <td class="center">{{$li.cutoff_money}}
         {{if $li.cutoff_money>0}}
        	&nbsp;&nbsp;&nbsp;<a href="/datareport/ajaxbutton?op=historyList&sku={{$li.sku}}&protector={{$li.protector}}" target="_blank"><img src="/fuman/images/icons/attachment.png"></a>
        {{/if}}
         </td>
        <td class="center">
        
        <a href="/datareport/externalBuyList?sku={{$li.sku}}" target="_blank">查看详细</a>
        
        
      
        </td>
      </tr>
      {{/foreach}}
        </tbody>
      
    </table>
    <div class="page">{{$pageList}}</div>
    <br />
    <br />
  </div>
</div>
<!--bodywrapper-->
<script language="javascript">
getalldata();
function getalldata()
{
	var starttime = $("#starttime").val();
	var endtime   = $("#endtime").val();
	var other	  = $("#other").val();
	var developer = $("#developer").val();
	
 $.post("/datareport/ajaxbutton", {"op": "getexternalBuy","starttime":starttime,"endtime":endtime,"other":other,"developer":developer},
	  function(data){
			$("#allcount").html("<font color=red>合计未结算提成："+data+" (RMB)</font>");
	  },"json");
}
function MergeProduct()
{
	$('#MergeProductform').modal('show');
}
</script>
<!-- 模态框（Modal） 结算-->
<form action="/datareport/ajaxbutton?op=saveexternalBuyDate"  method="post" name="uctform" id="uctform" >
  <div class="modal fade" id="MergeProductform" tabindex="-1" role="dialog" aria-labelledby="sMergeProductform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sMergeProductform">结算 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>当前结算时间&nbsp;&nbsp;&nbsp;<input type="text"  name="cutofftime" id="cutofftime" value="" onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
                </td>
            </tr>
            <tr>
            	<td>
                 开发者:
        <select name="kaideveloper" id="kaideveloper"  style="width:100px;" >
            <option value="0">所有人</option>
            {{foreach from=$userlist item=res key=key}}
            <option value="{{$res}}" {{if $developer eq $res}} selected{{/if}}>{{$res}}</option>
            {{/foreach}}
        </select>
                </td>
            </tr>
          <tr>
              <td style="line-height:25px;">关于结算说明：<br>
              1、新的商品未进行结算，结算时间以上架时间为准<br>
              2、当商品销售1个月或2个月，需要进行结算时，输入当前结算时间，
              输入的时间为下个周期结算时间起始点<br>
              3、保存结算时间后，商品提成统计自动进入下个周期<br>
              
              
             
             </td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('uctform','MergeProductform')"> 提交 </button>
<!--            <button type="submit" name="spa">保存</button>
-->          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）合并商品 -->
</body>
</html>